package com.chencong.online.function;

import com.chencong.online.bean.OrderEventBean;
import org.apache.flink.api.common.functions.MapFunction;

/**
 * @program: user-behavior-analysis-online
 * @ClassName OrderEventMapFunc
 * @description:将订单信息转为javabean函数
 * @author: chencong
 * @create: 2022-01-05 17:31
 **/
public class OrderEventMapFunc implements MapFunction<String, OrderEventBean> {
    @Override
    public OrderEventBean map(String value) throws Exception {
        String[] split = value.split(",");
        String orderId = split[0];
        String eventType = split[1];
        String txId = split[2];
        String timeStamp = split[3];
        return new OrderEventBean(Long.valueOf(orderId), eventType, txId, Long.valueOf(timeStamp));
    }
}
